package cn.codeforfun.service;

import cn.codeforfun.dao.UserDao;
import cn.codeforfun.entity.User;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

/**
 * Package cn.codeforfun.service
 * Project SpringBootCache
 * Author WangBin
 * Email bin.wang12@pactera.com
 * Created on 2017/6/8 15:20
 * version 1.0.0
 */
@Service
@Transactional
public class UserService {
  @Resource
  private UserDao userDao;

  public List<User> findAll() {
    return userDao.findAll();
  }

  public User findByUsername(String username) {
    return userDao.findByUsername(username);
  }

  public void saveUser(User user) {
    userDao.save(user);
  }
}
